<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue选项对象</title>
</head>
<body>
<div id="app">
    {{message}}
    <button v-on:click="demo_log('记录的信息')"></button>
</div>

<script src="../js/vue.js"></script>
<script>

    const message = {message: 'hello vue 我来了'};

    //数据冻结, 禁止调试
    //Object.freeze(message)

    const demo = new Vue({
        el: '#app',
        data: message,
        methods: {
            demo_log: function (param1){
                console.log(param1);
            }
        },
        created: function (){
            console.log("初始化时执行" +　this.message);
        },
        updated: function (){
            console.log("当数据发生新的渲染时触发" + this.message);
        }
    });
</script>
</body>
</html>